import { createRouter, createWebHashHistory } from 'vue-router'
import routerMap from './routerMap'
import 'nprogress/nprogress.css'
import Nprogress from 'nprogress'

const Router = createRouter({
  history: createWebHashHistory(),
  routes: routerMap,
})
// 路由拦截
Router.beforeEach((to, from, next) => {
  Nprogress.start()
  next()
})

Router.afterEach(() => {
  Nprogress.done()
})

export default Router
